package DDB;

import java.util.Arrays;

/**
 * String[] split(String regex):拆分
 * 将当前字符串按照满足正则表达式(regex)的部分进行拆分，将拆分出的以String[]形式返回
 */
public class SplitDemo {
    public static void main(String[] args) {//line String data split Arrays.toString(data) data.length
        String line="1op2123jr1q2er2321r1j2oe";
        String[]data=line.split("[a-z]");
        System.out.println(Arrays.toString(data));

        line="23423.2342...52342423.....5234234234....";
        data=line.split("\\.");
        System.out.println(Arrays.toString(data));

        line="..123..523.423523...346345.......3453454.....";
        data=line.split("\\.");
        System.out.println(Arrays.toString(data));
        System.out.println(data.length);































        /*String line = "abc123def456ghi";
        String[] data = line.split("[0-9]+");
        System.out.println(Arrays.toString(data));
        line = "123.456.78";
        data = line.split("\\.");
        System.out.println(Arrays.toString(data));
        line = ".123.456..78........";
        data = line.split("\\.");
        System.out.println(Arrays.toString(data));
        System.out.println(data.length); */
    }
}






















